﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace XGameFrame.Controls
{
    public class Label:Control
    {
        #region Constructor Region

        public Label(Vector2 pPosition,String pText)
            :base(pPosition)
        {
            Text = pText;
            tabStop = false;
            Size = getSizeForText(pText);
            Bounds = new Rectangle((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y);
            //UpdateBoundPositions();
        }
        /// <summary>
        /// the inherited class have to implement 
        /// </summary>
        /// <param name="pPosition"></param>
        public Label(Vector2 pPosition)
            : base(pPosition)
        {
            tabStop = false;
            //UpdateBoundPositions();
        }
        #endregion

        #region Abstract Methods

        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(SpriteFont, Text, Position, Color);
        }
        public override void HandleInput(PlayerIndex playerIndex)
        {
        }

        public override void OnHover(PlayerIndex playerIndex)
        {
        }


        #endregion
    }
}
